// import com.alibaba.druid.sql.ast.SQLExpr;
// import com.alibaba.druid.sql.dialect.oracle.ast.OracleSQLObjectImpl;
// import com.alibaba.druid.sql.dialect.oracle.visitor.OracleASTVisitor;

#include "OracleStorageClause.h"
#include "../../../../ast/SQLExpr.h"
#include "../../visitor/OracleASTVisitor.h"

OracleStorageClause_FlashCacheType_ptr OracleStorageClause_FlashCacheType::KEEP = OracleStorageClause_FlashCacheType_ptr(new OracleStorageClause_FlashCacheType(1ULL << 0, make_string_ptr("KEEP")));
OracleStorageClause_FlashCacheType_ptr OracleStorageClause_FlashCacheType::NONE = OracleStorageClause_FlashCacheType_ptr(new OracleStorageClause_FlashCacheType(1ULL << 1, make_string_ptr("NONE")));
OracleStorageClause_FlashCacheType_ptr OracleStorageClause_FlashCacheType::DEFAULT = OracleStorageClause_FlashCacheType_ptr(new OracleStorageClause_FlashCacheType(1ULL << 2, make_string_ptr("DEFAULT")));

OracleStorageClause_FlashCacheType::OracleStorageClause_FlashCacheType(uint64_t mask, string_ptr name)
{
  this->mask = mask;
  this->name = name;
}

SQLObject_ptr OracleStorageClause::clone()
{
  SQLObject_ptr clone_tmp = std::shared_ptr<OracleStorageClause>(new OracleStorageClause());
  std::shared_ptr<OracleStorageClause> x = std::dynamic_pointer_cast<OracleStorageClause>(clone_tmp);
  // OracleStorageClause x = new OracleStorageClause();
  if (initial != nullptr)
  {
    x->setInitial(std::dynamic_pointer_cast<SQLExpr>(initial->clone()));
  }
  if (next != nullptr)
  {
    x->setNext(std::dynamic_pointer_cast<SQLExpr>(next->clone()));
  }
  if (minExtents != nullptr)
  {
    x->setMinExtents(std::dynamic_pointer_cast<SQLExpr>(minExtents->clone()));
  }
  if (maxExtents != nullptr)
  {
    x->setMinExtents(std::dynamic_pointer_cast<SQLExpr>(maxExtents->clone()));
  }
  if (maxSize != nullptr)
  {
    x->setMaxSize(std::dynamic_pointer_cast<SQLExpr>(maxSize->clone()));
  }
  if (pctIncrease != nullptr)
  {
    x->setPctIncrease(std::dynamic_pointer_cast<SQLExpr>(pctIncrease->clone()));
  }
  if (freeLists != nullptr)
  {
    x->setFreeLists(std::dynamic_pointer_cast<SQLExpr>(freeLists->clone()));
  }
  if (freeListGroups != nullptr)
  {
    x->setFreeListGroups(std::dynamic_pointer_cast<SQLExpr>(freeListGroups->clone()));
  }
  if (bufferPool != nullptr)
  {
    x->setBufferPool(std::dynamic_pointer_cast<SQLExpr>(bufferPool->clone()));
  }
  if (objno != nullptr)
  {
    x->setObjno(std::dynamic_pointer_cast<SQLExpr>(objno->clone()));
  }
  x->flashCache = flashCache;
  x->cellFlashCache = cellFlashCache;
  return x;
}

// @Override
void OracleStorageClause::accept0(OracleASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(OracleStorageClause)))
  {
    acceptChild(visitor, initial);
    acceptChild(visitor, next);
    acceptChild(visitor, minExtents);
    acceptChild(visitor, maxExtents);
    acceptChild(visitor, maxSize);
    acceptChild(visitor, pctIncrease);
    acceptChild(visitor, freeLists);
    acceptChild(visitor, freeListGroups);
    acceptChild(visitor, bufferPool);
    acceptChild(visitor, objno);
  }
  visitor->endVisit(SharedObject(OracleStorageClause));
}

SQLExpr_ptr OracleStorageClause::getMaxSize()
{
  return maxSize;
}

void OracleStorageClause::setMaxSize(SQLExpr_ptr maxSize)
{
  this->maxSize = maxSize;
}

OracleStorageClause_FlashCacheType_ptr OracleStorageClause::getFlashCache()
{
  return flashCache;
}

void OracleStorageClause::setFlashCache(OracleStorageClause_FlashCacheType_ptr flashCache)
{
  this->flashCache = flashCache;
}

OracleStorageClause_FlashCacheType_ptr OracleStorageClause::getCellFlashCache()
{
  return cellFlashCache;
}

void OracleStorageClause::setCellFlashCache(OracleStorageClause_FlashCacheType_ptr cellFlashCache)
{
  this->cellFlashCache = cellFlashCache;
}

SQLExpr_ptr OracleStorageClause::getPctIncrease()
{
  return pctIncrease;
}

void OracleStorageClause::setPctIncrease(SQLExpr_ptr pctIncrease)
{
  this->pctIncrease = pctIncrease;
}

SQLExpr_ptr OracleStorageClause::getNext()
{
  return next;
}

void OracleStorageClause::setNext(SQLExpr_ptr next)
{
  this->next = next;
}

SQLExpr_ptr OracleStorageClause::getMinExtents()
{
  return minExtents;
}

void OracleStorageClause::setMinExtents(SQLExpr_ptr minExtents)
{
  this->minExtents = minExtents;
}

SQLExpr_ptr OracleStorageClause::getMaxExtents()
{
  return maxExtents;
}

void OracleStorageClause::setMaxExtents(SQLExpr_ptr maxExtents)
{
  this->maxExtents = maxExtents;
}

SQLExpr_ptr OracleStorageClause::getObjno()
{
  return objno;
}

void OracleStorageClause::setObjno(SQLExpr_ptr objno)
{
  this->objno = objno;
}

SQLExpr_ptr OracleStorageClause::getInitial()
{
  return initial;
}

void OracleStorageClause::setInitial(SQLExpr_ptr initial)
{
  this->initial = initial;
}

SQLExpr_ptr OracleStorageClause::getFreeLists()
{
  return freeLists;
}

void OracleStorageClause::setFreeLists(SQLExpr_ptr freeLists)
{
  this->freeLists = freeLists;
}

SQLExpr_ptr OracleStorageClause::getFreeListGroups()
{
  return freeListGroups;
}

void OracleStorageClause::setFreeListGroups(SQLExpr_ptr freeListGroups)
{
  this->freeListGroups = freeListGroups;
}

SQLExpr_ptr OracleStorageClause::getBufferPool()
{
  return bufferPool;
}

void OracleStorageClause::setBufferPool(SQLExpr_ptr bufferPool)
{
  this->bufferPool = bufferPool;
}
